$('#xsd_tabs').tabs({
    border: false,
    onSelect: function (title) {
        if (title == "销售单打印") {
            $.ajax({
                type: "POST",
                url: $.webPath() + '/xsgl/xsdgl/xsdDetail?xsdId=' + $("#xsd_id").val(),
                dataType: "html",
                beforeSend: function () {
                    $.messager.progress();
                },
                success: function (data) {
                    $.messager.progress("close");
                    $('#xsdy_xsd_id').html(data);
                    //=====================保供销售显示库存单价和库存金额    [name='bgxs_name']
                    var xslx = $("#xsd_detail_xslx").val();
                    if (xslx == "bgxs") {
                        $("[name='kcdj']").show(); //kcje
                        $("[name='kcje']").show();
                    } else {
                        $("[name='kcdj']").hide(); //kcje
                        $("[name='kcje']").hide();
                    }
                }
            });
        }
    }
});


$(function () {
    $("span.ljtip").ljDetail($("#xsd_detail_ljtip").val(), {
        position: 'top'
    });

    $("#xsd_xsdmx_table").datagrid({
        url: $.webPath() + '/xsgl/xsdgl/xsdgl_xsmx?xsdId=' + $("#xsd_id").val(),
        width: 1700,
        fitColumns: false,
        singleSelect: true,
        fit: true,
        showFooter: true,
        rownumbers: true,
        columns: [
            [
                {field: 'xsxt_xsdh', title: '合同子项号', width: 150, align: 'center'},
                {field: 'wzgg.name', title: '物资名称', width: 100, align: 'center'},
                {field: 'wzgg.cz', title: '材质', width: 50, align: 'center'},
                {field: 'wzgg.ggxh', title: '规格型号', width: 100, align: 'center'},
                {field: 'carNo', title: '车皮号', width: 85},
                {field: 'bindNo', title: '捆包号', align: 'center', width: 100},
                {field: 'wzgg.th', title: '图号', hidden: true, align: 'center'},
                {field: 'ck', title: '长宽', hidden: true, align: 'right'},
                {field: 'wzgg.dw', title: '单位', width: 50, align: 'center'},
                {field: 'jzfs.z', title: '记重方式', width: 50, align: 'center'},
                {field: 'kh.khbm', title: '卡号', width: 120, align: 'center'},
                {field: 'js', title: '件数', width: 50, align: 'right'},
                {field: 'sbsl', title: '重量', width: 100, align: 'right',
                    formatter: function (value) {
                        var sl = formatSlForHtml(value, ",");
                        return sl;
                    }},
                {field: 'hsj', title: '含税单价(元)', width: 150, align: 'right',
                    formatter: function (value) {
                        var sl = formatJeForHtml(value);
                        return sl;
                    } },
                {field: 'sjdj', title: '实际单价', width: 150, align: 'right',
                    formatter: function (value) {
                        var sl = formatJeForHtml(value);
                        return sl;
                    } },
                {field: 'hse', title: '含税总金额(元)', width: 150, align: 'right',
                    formatter: function (value) {
                        var sl = formatJeForHtml2(value);
                        return sl;
                    } },
                {field: 'bhsj', title: '不含税单价(元)', width: 150, align: 'right',
                    formatter: function (value) {
                        var sl = formatJeForHtml(value);
                        return sl;
                    } },
                {field: 'zjfpje', title: '购货总金额(元)', width: 150, align: 'right',
                    formatter: function (value) {
                        var sl = formatJeForHtml(value);
                        return sl;
                    } },
                {field: 'cgd.cgdh', title: '采购单号', align: 'center', formatter: function (value, row) {
                    if (row['cgd.id']) {
                        return "<a style='color:red' href='javascript:void(0);' onclick='viewXsdglCgdDetail(" + row['cgd.id'] + ")'>" + value + "</a>";
                    } else
                        return value;
                }, width: 100},
                {field: 'jsdh', title: '结算单号', align: 'center', width: 100, formatter: xsdToXsjsdCell}

            ]
        ],
        loadFilter: function (data) {
            $.each(data.rows, function () {
                if (this.hsj) {
                    this.hse = Math.round(multiply(this.sbsl, this.hsj) * 100) / 100;
                }
                if (this.bhsj) {
                    this.bhse = Math.round((this.hse / (1 + $("#xsd_detail_sl").val() / 100)) * 100) / 100;
                }
            })
            return data;
        },
        onLoadSuccess: function () {
            $(".datagrid-htable .datagrid-cell").css('text-align', 'center');
        }
    })

 /*   $("#xsd_xsdfy_table").datagrid({
        onLoadSuccess: function () {
            $(".datagrid-htable .datagrid-cell").css('text-align', 'center');
        }
    })*/
    //=================销售单 出售联 提货单 送货单  按钮切换===================
  /*  $('#xsd_thd').click(function () {
        $("#xsddy_csl").hide();
        $("#xsddy_thd").show();
        $("#xsddy_shd").hide();

        $("[name='bhs']").show();
        $("[name='hs']").show();
        $("[name='wse']").show();
        $("[name='hse']").show();
        $("[name='se']").show();
    });*/

   /* $('#xsd_shd').click(function () {
        $("#xsddy_csl").hide();
        $("#xsddy_thd").hide();
        $("#xsddy_shd").show();

        $("[name='bhs']").hide();
        $("[name='hs']").hide();
        $("[name='wse']").hide();
        $("[name='hse']").hide();
        $("[name='se']").hide();
    });*/
    //================勾选所选项==================================

    //含税单价
/*    $('#xsmx_hsj').bind('click', function () {
        var hs = $('#xsmx_hsj_1').val();
        if (hs == 'on') {
            $("[name='hsj_dy']").hide();
            $('#xsmx_hsj_1').val('off');
        } else if (hs == 'off') {
            $("[name='hsj_dy']").show();
            $('#xsmx_hsj_1').val('on');
        }
    });*/

    //含税额
/*    $('#xsmx_hse').bind('click', function () {
        var hse = $('#xsmx_hse_1').val();
        if (hse == 'on') {
            $("[name='hse_dy']").hide();
            $('#xsmx_hse_1').val('off');
        } else if (hse == 'off') {
            $("[name='hse_dy']").show();
            $('#xsmx_hse_1').val('on');
        }
    });*/
    //=============================================================
})

function viewXsdglXshtDetail(id) {
    $.window({
        iconCls: 'icon-tip',
        title: "详细信息",
        url: $.webPath() + "/htgl/xshtgl/xshtgl_detail?xshtId=" + id,
        width: 1050,
        height: 500,
        modal: true,
        isMax: false
    })
}
//=============按钮事件=============================


//  点击出售联，隐藏出库数量
/*function cslClick1(tdName) { // alert(tdName);
 $("[name='" + tdName + "']").show();
 $("#xsdy_ck").hide();
 // $("#xsdy_tdrq").hide();

 $("#xsddy_csl").show();
 $("#xsddy_thd").hide();
 $("#xsddy_shd").hide();
 }*/
/*//点击 记账联，显示出库数量
 function jzlClick(tdName) {
 //alert(tdName);
 $("[name='" + tdName + "']").show();
 }*/
//点击 提货单，显示出库数量
/*function thdClick1(tdName) {
 $("[name='" + tdName + "']").show();
 $("#xsdy_ck").hide();
 // $("#xsdy_tdrq").hide();

 $("#xsddy_csl").hide();
 $("#xsddy_thd").show();
 $("#xsddy_shd").hide();
 }*/
//点击   送货单，显示出库数量
/*function shdClick1(tdName) {
 $("[name='" + tdName + "']").hide();
 $("#xsdy_ck").show();
 //  $("#xsdy_tdrq").show();

 $("#xsddy_csl").hide();
 $("#xsddy_thd").hide();
 $("#xsddy_shd").show();
 }*/

// 导word格式
function exportWord() {
    var xsdId = $("#xsd_id").val();
    window.open($.webPath() + "/xsgl/xsdgl/exportWord?xsdId=" + xsdId);
}

/**
 * 保存页面修改元素
 */
function savePrintElement() {
    //打印前把几个问题
    var zh = $("#xsd_zh").val();
    var lsh = $("#xsd_lsh").val();
    $("#xsd_lsh_htm").html(lsh);
    var thrs = $("#xsd_thrs").val();
    $("#xsd_thrs_htm").html(thrs);
    var jbr = $("#xsd_jbr").val();
    $("#xsd_jbr_htm").html(jbr);
    var sfzhm = $("#xsd_sfzhm").val();
    $("#xsd_sfzhm_htm").html(sfzhm);
    var cars = $("#xsd_cars").val();
    $("#xsd_cars_htm").html(cars);
    var xsdId = $("#xsd_id").val();
    var year = $("#xsd_year").val();
    var month = $("#xsd_month").val();
    var day = $("#xsd_day").val();
    if (!zh || !lsh || !thrs || !jbr || !sfzhm || !cars || !year || !month || !day) {
        $.messager.alert("提示", "提货人信息不能为空！", "waring");
        return false;
    }
    if (lsh != undefined) {
        $.post($.webPath() + '/xsgl/xsdgl/save_print_elements', {xsdId: xsdId, zh: zh, lsh: lsh, thrs: thrs, jbr: jbr, sfzhm: sfzhm, cars: cars, year: year, month: month, day: day}, function (data) {
            var obj = eval('(' + data + ')');
//        if (obj.statusCode == '200') {
//            $.messager.alert('提示', obj.message, 'info');
//        }
        });
    }
}

// 销售单打印预览
function xsdyPrintPreview() {
//    if ($("#xsdzt").val() == "ybc") {
//        alert("此单据必须提交后才能进行打印!");
//        return;
//    }
    var LODOP = getLodop(document.getElementById('XSD_LODOP_OB'), document.getElementById('XSD_LODOP_EM'));
    LODOP.SET_PRINT_STYLEA(0, "NotOnlyHighPrecision", true);
    LODOP.PRINT_INIT("预览销售单");

    var strBodyStyle = "<style  type=\"text/css\">" +
        ".textcon{padding:8px;}" +
        ".input-tian{border-top:0 none;border-left:0 none;border-right:0 none;border-bottom: 1px solid black;height:22px;line-height:22px;width:100%;font-weight: bold;}" +
        ".input-tian2{border-top:0 none;border-left:0 none;border-right:0 none;border-bottom: 1px solid black;height:22px;line-height:22px;width:50px;font-weight: bold;}" +
        ".input-tian3{border-top:0 none;border-left:0 none;border-right:0 none;border-bottom: 1px solid black;height:22px;line-height:22px;width:200px;font-weight: bold;}" +
        ".input-tian4{border-top:0 none;border-left:0 none;border-right:0 none;border-bottom: 0px solid black;height:26px;width:50px;font-weight: 500;font-size:17px;}" +
        " select{display:none}" +
        ".tb{width:auto;border-collapse:collapse;border-spacing:0;}" +
        ".tb th{padding:2px 2px 2px 12px;font-size:12px;font-weight:normal;text-align: right;}" +
        ".tb td{padding:2px;font-size:12px;}" +
        ".tb caption{ font-size:24px;height:60px;line-height:20px;}" +
        ".intb{width: 100%;}" +
        ".intb,.intb th,.intb td{border:1px solid black;}" +
        "</style>";
    var strFormHtmltop = strBodyStyle + "<div class='textcon'>" + document.getElementById("xsdy_print_id").innerHTML + "</div>";
    var strFormHtmlbody = strBodyStyle + "<div class='textcon'>" + document.getElementById("xsdy_xsd_id").innerHTML + "</div>";
    var strFormHtmlBottom = strBodyStyle + "<div class='textcon'>" + document.getElementById("xsdy_detail_id").innerHTML + "</div>";
    var xsd_xsdh = $("#xsd_xsdh").val();
    var xsd_ewmtime = $("#xsd_ewmtime").val();

//    LODOP.SET_PRINT_PAGESIZE(0, '2600', '1230', "CreateCustomPage");
//    LODOP.ADD_PRINT_HTM(50, 80, "82%", "90%", strFormHtmltop + strFormHtmlbody + strFormHtmlBottom);
//    LODOP.ADD_PRINT_BARCODE(50, "85%", 90, 90, 'QRCode', xsd_xsdh + " " + xsd_ewmtime);
//    LODOP.SET_PRINT_PAGESIZE(0, '2600', '1230', "CreateCustomPage");
//    LODOP.ADD_PRINT_TABLE(281, "1.5%", "90%", 106, strFormHtmlbody);
//    LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
    LODOP.ADD_PRINT_HTM(73, "1.5%", "90%", 498, strFormHtmltop + strFormHtmlbody + "<div style='height: 100px'></div>" + strFormHtmlBottom);
//    LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
//    LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
//    LODOP.ADD_PRINT_HTM(398, "1.5%", "90%", 105, strFormHtmlBottom);
//    LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
//    LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
//    LODOP.ADD_PRINT_BARCODE(20, "85%", 90, 90, 'QRCode', xsd_xsdh + " " + xsd_ewmtime);
//    LODOP.SET_PRINT_STYLEA(0, "QRCodeVersion", 3);
    LODOP.ADD_PRINT_TEXT(5, "80%", 135, 20, "总页号：第#页/共&页");
    LODOP.SET_PRINT_STYLEA(0, "ItemType", 2);
    LODOP.SET_PRINT_STYLEA(0, "Horient", 1);

//    LODOP.PRINT_DESIGN();
    LODOP.PREVIEW();

//
//    var strStyle="<style> table,td,th {border-width: 1px;border-style: solid;border-collapse: collapse}</style>"
//    LODOP.ADD_PRINT_TABLE(128,"5%","90%",314,strStyle+document.getElementById("div2").innerHTML);
//    LODOP.SET_PRINT_STYLEA(0,"Vorient",3);
//    LODOP.ADD_PRINT_HTM(20,"5%","90%",109,document.getElementById("div1").innerHTML);
//    LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
//    LODOP.SET_PRINT_STYLEA(0,"LinkedItem",1);
//    LODOP.ADD_PRINT_HTM(444,"5%","90%",54,document.getElementById("div3").innerHTML);
//    LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
//    LODOP.SET_PRINT_STYLEA(0,"LinkedItem",1);

}

//销售单打印
function xsdyPrint() {
    var LODOP = getLodop(document.getElementById('XSD_LODOP_OB'), document.getElementById('XSD_LODOP_EM'));
    LODOP.SET_PRINT_STYLEA(0, "NotOnlyHighPrecision", true);
    LODOP.PRINT_INIT("打印销售单");
    LODOP.SET_PRINT_STYLE("FontSize", 18);

    /*var inputs = document.getElementById("xsdy_id").getElementsByTagName("input");
     for (var i = 0; i < inputs.length; i++) {
     inputs[i].setAttribute("value", inputs[i].value);
     }*/
    var strBodyStyle = "<style  type=\"text/css\">" +
        ".textcon{padding:8px;}" +
        ".input-tian{border-top:0 none;border-left:0 none;border-right:0 none;border-bottom: 1px solid black;height:22px;line-height:22px;width:100%;font-weight: bold;}" +
        " select{display:none}" +
        ".tb{width:auto;border-collapse:collapse;border-spacing:0;}" +
        ".tb th{padding:2px 2px 2px 12px;font-size:12px;font-weight:normal;text-align: right;}" +
        ".tb td{padding:2px;font-size:12px;}" +
        ".tb caption{ font-size:24px;height:60px;line-height:20px;}" +
        ".intb{width: 100%;}" +
        ".intb,.intb th,.intb td{border:1px solid black;}" +
        "</style>";
    var strFormHtmltop = strBodyStyle + "<div class='textcon'>" + document.getElementById("xsdy_print_id").innerHTML + "</div>";
    var strFormHtmlbody = strBodyStyle + "<div class='textcon'>" + document.getElementById("xsdy_xsd_id").innerHTML + "</div>";
    var strFormHtmlBottom = strBodyStyle + "<div class='textcon'>" + document.getElementById("xsdy_detail_id").innerHTML + "</div>";
    var xsd_xsdh = $("#xsd_xsdh").val();
    var xsd_ewmtime = $("#xsd_ewmtime").val();

//    LODOP.SET_PRINT_PAGESIZE(0, '2600', '1230', "CreateCustomPage");
//    LODOP.ADD_PRINT_HTM(50, 80, "82%", "90%", strFormHtmltop + strFormHtmlbody + strFormHtmlBottom);
//    LODOP.ADD_PRINT_BARCODE(50, "85%", 90, 90, 'QRCode', xsd_xsdh + " " + xsd_ewmtime);
//    LODOP.SET_PRINT_PAGESIZE(0, '2600', '1230', "CreateCustomPage");
    LODOP.ADD_PRINT_TABLE(135, "1.5%", "90%", 350, strFormHtmlbody);
    LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
    LODOP.ADD_PRINT_HTM(20, "1.5%", "90%", 145, strFormHtmltop);
    LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
    LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
    LODOP.ADD_PRINT_HTM(495, "1.5%", "90%", 200, strFormHtmlBottom);
    LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
    LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
//    LODOP.ADD_PRINT_BARCODE(20, "85%", 90, 90, 'QRCode', xsd_xsdh + " " + xsd_ewmtime);
//    LODOP.SET_PRINT_STYLEA(0, "QRCodeVersion", 3);
    LODOP.ADD_PRINT_TEXT(5, "80%", 135, 20, "总页号：第#页/共&页");
    LODOP.SET_PRINT_STYLEA(0, "ItemType", 2);
    LODOP.SET_PRINT_STYLEA(0, "Horient", 1);
    LODOP.PREVIEW();
}

function CreatePrintPage1() {
    if ($("#xsdzt").val() == "ybc") {
        alert("此单据必须提交后才能进行打印!");
        return;
    }

    var xsdId = $("#xsd_id").val();
    var shdw = $("#xsddetail_kh").val();
    var thgs = $("#xsddetail_xsgs").val();
    var xsdDzck = $("#xsd_thck_detail").val();
    var xsdDzckDz = $("#xsd_thzckdz_detail").val();
    var xsdZdrq = $("#xsddetail_sxsj").val();
    var arg_xsdZdrq = xsdZdrq.split("-");
    var xsdZdrq_year = arg_xsdZdrq[0];
    var xsdZdrq_month = arg_xsdZdrq[1];
    var xsdZdrq_day = arg_xsdZdrq[2];
    var xsdThrq = $("#xsddetail_jhrq").val();
    var arg_xsdThrq = xsdThrq.split("-");
    var xsdThrq_year = arg_xsdThrq[0];
    var xsdThrq_month = arg_xsdThrq[1];
    var xsdThrq_day = arg_xsdThrq[2];
    var xsdBz = $("#xsd_bz").val();
    var xsdXtdh = $("#xsddetail_xsdh").val();
    var ysgjList = $("#ysgjList").val();

    $.post($.webPath() + '/xsgl/xsdgl/xsdDetailForTd',
        {'xsdId': xsdId},
        function (mxData) {
            var json = $.parseJSON(mxData);

            var LODOP = getLodop(document.getElementById('XSD_LODOP_OB'), document.getElementById('XSD_LODOP_EM'));
            LODOP.PRINT_INITA(-10, 0, 1004, 697, "");
            LODOP.ADD_PRINT_SETUP_BKIMG("<img src='" + $.webPath() + "/images/1234.jpg'/>");
            LODOP.SET_PRINT_PAGESIZE(0, 2550, 1770, "A4");
            LODOP.SET_SHOW_MODE("BKIMG_IN_PREVIEW", 1);
//            LODOP.SET_PRINT_MODE("PRINT_PAGE_PERCENT",'Auto-Width');
            LODOP.SET_PREVIEW_WINDOW(1, 0, 0, 0, 0, '');
            LODOP.ADD_PRINT_TEXT(86, 588, 151, 36, thgs);
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(193, 162, 271, 22, shdw);
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(214, 180, 235, 20, ysgjList);
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(233, 164, 267, 20, xsdDzck);
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(234, 504, 163, 20, xsdDzckDz);
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(566, 161, 779, 20, "销售单号:" + xsdXtdh + "   " + xsdBz);
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(167, 156, 49, 24, xsdZdrq_year);
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(168, 471, 49, 24, xsdThrq_year);
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
//            LODOP.ADD_PRINT_TEXT(168, 763, 183, 25, xsdXtdh);
            LODOP.ADD_PRINT_TEXT(168, 220, 33, 24, xsdZdrq_month);
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(168, 272, 33, 24, xsdZdrq_day);
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(168, 533, 33, 24, xsdThrq_month);
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(168, 578, 33, 24, xsdThrq_day);
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

            var js = 0;
            var sbsl = 0;
            var ckjs = 0;
            var cksl = 0;
            var hsj = 0;
            var je = 0;
            $.each(json, function (i, val) {
                js += val.js == null ? 0 : val.js;
                sbsl += val.sbsl == null ? 0 : val.sbsl;
                ckjs += val.ck_js == null ? 0 : val.ck_js;
                cksl += val.ck_sbsl == null ? 0 : val.ck_sbsl;
                hsj += val.hsj == null ? 0 : val.hsj;
                je += (val.hsj * val.sbsl);
                //   LODOP.ADD_PRINT_TEXT(277 + (i * 22), 90, 80, 20, val['wzgg.code']);
                //  LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
                LODOP.ADD_PRINT_TEXT(277 + (i * 22), 165, 53, 20, val['wzgg.name']);
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_TEXT(277 + (i * 22), 218, 52, 20, val['cd.z']);
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_TEXT(277 + (i * 22), 274, 65, 20, val['wzgg.cz']);
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_TEXT(277 + (i * 22), 330, 55, 20, val['wzgg.ggxh']);
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                //    LODOP.ADD_PRINT_TEXT(277 + (i * 22), 384, 55, 20, val['kh.khbm']);
                //  LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
                LODOP.ADD_PRINT_TEXT(277 + (i * 22), 434, 68, 20, !val.js ? 0.0000 : val.js);
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_TEXT(277 + (i * 22), 505, 83, 20, !val.sbsl ? 0.0000 : formatSl(val.sbsl, ","));
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_TEXT(277 + (i * 22), 584, 84, 20, !val.ck_js ? '' : val.ck_js);
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_TEXT(277 + (i * 22), 667, 110, 20, !val.ck_sbsl ? '' : formatSl(val.ck_sbsl, ","));
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_TEXT(277 + (i * 22), 773, 81, 20, !val.hsj ? 0.0000 : formatJe2(val.hsj, ","));
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_TEXT(277 + (i * 22), 848, 100, 20, formatJe(val.hsj * val.sbsl, ","));
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            });
            LODOP.ADD_PRINT_TEXT(450, 435, 70, 20, js);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(450, 501, 79, 20, formatSl(sbsl, ","));
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(450, 582, 84, 20, '');
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(450, 671, 105, 20, '');
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
//            LODOP.ADD_PRINT_TEXT(450,771,80,20,formatJe(hsj,","));
//            LODOP.SET_PRINT_STYLEA(0,"Bold",1);
            LODOP.ADD_PRINT_TEXT(450, 848, 100, 20, formatJe(je, ","));
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

            //LODOP.PRINT_DESIGN();
            LODOP.PREVIEW();
        }
    );

}

//function CreatePrintPage() {
//    var LODOP = getLodop(document.getElementById('XSD_LODOP_OB'), document.getElementById('XSD_LODOP_EM'));
//    // LODOP.PRINT_INIT("套打EMS的模板");
//    LODOP.PRINT_DESIGN();
//}
//;
